<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	request.setAttribute("path", request.getContextPath());
%>
<script type="text/javascript">
$(function(){
	queryShopUser();
});
function queryShopUser(){
	var formData = $("#queryShopUserForm").serialize();
	common.progressDialog("...查询中...");
	$.post("${root}/shop/user/list", formData,function(html){
		$("#shopUserDataList").html(html);
		common.closeProgressDialog();
	});
}
function deleteById( id ){
	if(confirm("确定删除此人员!")){
		var url = "${root}/shop/user/delete/" + id;
		common.ajaxSubmit( url ,"","删除网点人员失败,请重试!","",'queryShopUser()');
	}
}

function popShopUsers(){

	var uri = "${root}/shop/user/list/pop/${param.shopId}";
	$.post(uri,function( html ){
		common.moalYesNoDialog(html,"网点人员设置","addShopUser()");
	});
}
function addShopUser(){

	var uri = "${root}/shop/user/add/${param.shopId}";
	var param = "";
	$("input[type='checkbox'][id*='userItem']:checked").each(function(index){
		if(index == 0 ){
			param += "userId="+$(this).val();
		}else{
			param+="&userId="+$(this).val();
		}
	});
	common.closeYesNoDialog();
	common.ajaxSubmitWithData(uri,param,"增加人员失败","",'queryShopUser()');
	
}
</script>
 <jsp:include page="shop_tabs.jsp"></jsp:include>
<jsp:include page="../../base/master_js.jsp"></jsp:include>
<form class="form-horizontal" id="queryShopUserForm">
	<input name="orderName" value="au.name" type="hidden">
	<input name="id" value="${param.shopId}" type="hidden">
	<table class="table table-hover">
		<tr>
			<th>账号:</th>
			<td><input type="text" class="input-xlarge" name="userId"/></td>
			<th>姓名:</th>
			<td><input type="text" class="input-xlarge" name="userName"/></td>
		</tr>
	</table>

	<div class="form-actions text-center">
		      <button type="button" class="btn btn-primary" onclick="queryShopUser()">查询</button>
		      <button type="button" class="btn btn-success"  onclick="popShopUsers()">新增</button>
	 </div>
</form>
<div class="table-responsive">
<table class="table table-striped table-bordered">
	<thead>
		<tr >
		    <th class="span2 text-center">序号</th>
			<th class="span3 text-center">账号</th>
			<th class="text-center">名称</th>
			<th class="span3 text-center">操作</th>
		</tr>
	</thead>
	<tbody id="shopUserDataList">
	</tbody>
</table>
</div>

